﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Linq;
using System.Web;

namespace WCLOnlineExam.Models
{
    public class Exam : EntityBase 
    {
        [Display(Name = "题目", Order = 10)]
        [Required]
        public virtual string Name { get; set; }

        [Display(Name = "内容", Order = 10)]
        [Required]
        public virtual string Content { get; set; }

        [Display(Name = "考试时长", Order = 10)]
        [Required]
        public virtual string Duration { get; set; }

        [Display(Name = "总分", Order = 10)]
        [Required]
        public virtual int TotalPoint { get; set; }

        [CustomDataType("Collection")]
        [Required]
        public virtual ICollection<Question> Question { get; set; }

        [CustomDataType("Collection")]
        public virtual ICollection<UserGroup> UserGroup { get; set; }


        public override string ToString()
        {
            return this.Name;
        }
    }
}